Skip to content

fix(lint): isolate pydoclint to end docstring-parser-fork collision#21

Merged
rustyconover merged 1 commit into
mainfrom
fix/isolate-pydoclint-docstring-collision
Jun 22, 2026
Merged

fix(lint): isolate pydoclint to end docstring-parser-fork collision#21
rustyconover merged 1 commit into
mainfrom
fix/isolate-pydoclint-docstring-collision

Conversation

@rustyconover

Copy link
Copy Markdown
Collaborator

Problem

The Lint gate was flaky in a way that surfaced on the cryptography 48→49 Dependabot PR (#17): pydoclint crashed with

ImportError: cannot import name 'DocstringYields' from 'docstring_parser.common'

Root cause: pydoclint depends on docstring-parser-fork, which installs into the same docstring_parser/ import namespace as the canonical docstring-parser that vgi_rpc imports at runtime (rpc/_types.py). With both in one venv, whichever uv installs last wins — non-deterministic. Unrelated dependency bumps reorder the install graph; when the canonical package shadows the fork, the symbols pydoclint needs disappear and it crashes. The bug was latent on main (the fork happened to win there), so it only appeared once #17 perturbed the order.

docstring-parser-fork is pulled in only by pydoclint:

docstring-parser-fork v0.0.14
└── pydoclint v0.8.7
    └── vgi-rpc (group: dev)

Fix

Stop co-installing the fork with the canonical package: remove pydoclint from the dev group and run it isolated via uvx.

  • pyproject.toml — drop pydoclint>=0.8 from the dev group; document why; update the [tool.pydoclint] run note.
  • ci.ymluvx --python 3.13 --from pydoclint==0.8.7 pydoclint vgi_rpc/ (the --python 3.13 is required so the isolated parser understands the package's 3.13 syntax).
  • CLAUDE.md — update the step-3 command.
  • uv.lock — regenerated; pydoclint and docstring-parser-fork removed. The project venv now resolves only canonical docstring-parser 0.18.0.

Verification

  • Project venv now contains only docstring_parser-0.18.0 (no fork).
  • Runtime import from docstring_parser import DocstringStyle, parse → ok.
  • uvx --python 3.13 --from pydoclint==0.8.7 pydoclint vgi_rpc/ → 🎉 No violations.
  • ruff format --check, ruff check, mypy, ty all clean.
  • pytest (introspection/docstring/type subset) → 543 passed.

Unblocks #17, which will pass Lint deterministically once rebased on this.

🤖 Generated with Claude Code

pydoclint depends on `docstring-parser-fork`, which installs into the same
`docstring_parser/` import namespace as the canonical `docstring-parser` that
vgi_rpc imports at runtime (rpc/_types.py). With both in one venv, whichever uv
installs last wins — a non-deterministic race. Unrelated dependency bumps (e.g.
the cryptography 48->49 PR) reorder the install graph, so the canonical package
can shadow the fork and drop symbols pydoclint needs (DocstringYields),
crashing the lint gate with an ImportError. The failure was latent on main: the
fork happened to win there.

Remove pydoclint from the dev dependency group and run it isolated via
`uvx --python 3.13 --from pydoclint==0.8.7 pydoclint vgi_rpc/` in CI and the
local workflow. The project venv now resolves only the canonical
docstring-parser; pydoclint (and its fork) live in an ephemeral uvx env. Lint
is deterministic and no longer perturbed by unrelated bumps.

- pyproject.toml: drop `pydoclint>=0.8` from dev group; document why; update the
  [tool.pydoclint] run instruction.
- ci.yml: run pydoclint via uvx (--python 3.13 so it parses 3.13 syntax).
- CLAUDE.md: update the step-3 command.
- uv.lock: regenerated (pydoclint + docstring-parser-fork removed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rustyconover rustyconover merged commit 013aada into main Jun 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant